package com.mythread.www;

/**
 * Created by yueya on 2017/5/16.
 * 验证线程的随机性
 */
public class ThreadRandomness extends Thread{
    public void run(){
        try{
            for (int i = 0; i < 10; i++){
                int time = (int)(Math.random() * 1000);
                Thread.sleep(time);
                System.out.println("main=" + Thread.currentThread().getName());
            }
        }catch(InterruptedException e){
            e.printStackTrace();
        }
    }
}
